<template>
  <view class="myResume" style="width:100%">
    <view class="myResumeBox" v-if="jobSeekersList">
      <view class="homeTop">
        <u-icon
          class="homeTopTest"
          @click="back"
          name="arrow-left"
          color="#fff"
          size="36"
        ></u-icon>
        <text>简历详情</text>
      </view>
      <view class="myResumeBoxTop">
        <view class="myResumeBoxTopbetween">
          <view>
            <view class="myResumeBoxTopName">
              {{ jobSeekersList.name }}
              <img
                class="xingbie"
                :src="jobSeekersList.gender ? '/pushPages/img/nan.png' : '/pushPages/img/nv.png'"
                alt
              />
            </view>
            <view class="myResumeBoxTopAddress">工作城市：{{ jobSeekersList.address }}</view>
            <view class="myResumeBoxTopphone">手机号码：{{ jobSeekersList.phone }}</view>
          </view>
          <view>
            <img
              src="../../../static/avatar.jpeg"
              class="myResumeBoxTopAvatar"
              alt
            />
          </view>
        </view>
        <view style="margin-top:13px" v-if="jobSeekersList.skill">
          <text
            class="myResumeBoxTopLable"
            v-for="i in jobSeekersList.skill.split(',')"
            :key="i"
            >{{ i }}</text
          >
        </view>
      </view>
      <view class="myResumeBoxCon">
        <view class="recruitDetailsZWMS">
          <text class="zwmsBorder"></text>备注信息
        </view>
        <view class="myResumeBoxConBZXX">{{ jobSeekersList.remark }}</view>
        <view class="recruitDetailsZWMS">
          <text class="zwmsBorder"></text>附件简历
        </view>
        <view class="recruitDetailsfjjianli" v-if="jobSeekersList.annex">
          <view class="recruitDetailsfjjianli1">
            <img class="jianliimg" src="../../static/shangchuan.png" alt />
            <view>
              <view class="recruitDetailsfjjianli2">{{ jobSeekersList.name }}简历</view>
            </view>
          </view>
          <view class="recruitDetailsfjjianli4" @click="toView">查看预览</view>
        </view>
      </view>
      <view style="height:100px"></view>
      <view class="myResumeBoxBottom">
        <button class="myResumeBoxBottomEdit" @click="edit">编辑</button>
      </view>
    </view>
  </view>
</template>
<script>
import { mapState } from "vuex";
import { jobSeekers } from "./api";
export default {
  name: "MineTab",
  props: {},
  data() {
    return {
      jobSeekersListAannex: false,
      jobSeekersList: null,
      mescroll: null,
      weixinInfo: {}
    };
  },
  computed: {
    ...mapState(["user", "site", "jobSeeker"])
  },
  watch: {},
  onShow() {
    this.jobSeekers();
  },

  methods: {
    edit() {
      uni.navigateTo({
        url: `/pages/applyJob/editApplyJob/editApplyJob?selectFirstUser=${JSON.stringify(
          this.jobSeekersList
        )}`
      });
    },
    toView() {
      // wx.previewImage({
      //   current: this.jobSeekersList.annex,
      //   urls: [this.jobSeekersList.annex]
      // });
      // uni.downloadFile({
      //   url: this.jobSeekersList.annex, // 可以是后台返回的地址。这里写的是死的
      //   success: function(res) {
      //     var filePath = res.tempFilePath; // 小程序中文件的临时文件
      //     uni.openDocument({
      //       filePath: filePath,
      //       success: function(res) {
      //         console.log("打开文档成功");
      //       },
      //       fail: e => {
      //         console.log(e);
      //       }
      //     });
      //   },
      //   fail: e => {
      //     console.log(e);
      //   }
      // });
      // uni.downloadFile({
      //   url: this.jobSeekersList.annex,
      //   success(res) {
      //     if (res.statusCode === 200) {
      //       uni.playVoice({
      //         filePath: res.tempFilePath
      //       });
      //     }
      //   }
      // });
    },
    back() {
      uni.navigateBack();
    },
    jobSeekers() {
      jobSeekers(this.user.loginid)
        .then(res => {
          this.jobSeekersList = res;
          console.log("res", res);
        })
        .catch(err => {
          console.log(err);
        });
    }
  }
};
</script>
<style lang="scss">
@import "../../../styles/styles.scss";
@import "./index.scss";
</style>
